package com.example.flower_shop.dto.order;

import com.example.flower_shop.dto.product.ProductVO;
import com.example.flower_shop.entity.OrderItem;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@NoArgsConstructor
public class OrderItemVO {
    private Long id;
    private ProductVO product;
    private String productName;
    private BigDecimal productPrice;
    private Integer quantity;

    public OrderItemVO(OrderItem orderItem) {
        this.id = orderItem.getId();
        this.product = new ProductVO(orderItem.getProduct());
        this.productName = orderItem.getProductName();
        this.productPrice = orderItem.getProductPrice();
        this.quantity = orderItem.getQuantity();
    }
}